<template>
  <div>
    <el-menu
      default-active="2"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      router
    >
      <template v-for="item in this.showData">
        <el-submenu
          v-if="item.ChildMenus!=null"
          :index="item.MenuNumber"
          :key="item.MenuNumber"
        >
          <template slot="title">
            <i v-bind:class="item.Icon"></i>
            <span>{{ item.MenuName }}</span>
          </template>
          <MenuTree :showData="item.ChildMenus"></MenuTree>
        </el-submenu>
        <el-menu-item v-else :key="item.MenuNumber" :index="item.Url">
          <i :class="item.Icon"></i>
          {{ item.MenuName }}</el-menu-item
        >
      </template>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "MenuTree",
  data() {
    return {};
  },
  props: ["showData"], //子组件接收父组件的数据
  components: {},
};
</script>

<style>
</style>